{extend name="app/shop/view/base.html"/}
{block name="resources"}
<style>
	.view-button-btn{display:inline-block;user-select:none;padding:6px 16px;border-radius:4px;touch-action:manipulation;cursor:pointer;background-image:none;border:1px solid transparent;white-space:nowrap;margin-bottom:0;font-weight:400;text-align:center}
	.view-button-btn-first{width:250px;font-size:14px;color:#fff;margin-right:10px;line-height:26px}
	.view-button-btn-last{width:150px;line-height:28px;font-size:14px;color:#4dbe2e;margin-right:10px;background-color:#fff;border-color:#4dbe2e}
	.view-button-btn-first:hover{color:#fff}
	.view-button-btn-last:hover{color:#4dbe2e;}
	.view-msg{padding:24px 0 16px;font-size:12px;color:#666}
	.view-more{float:right;font-size:12px;color:#999}
	.view-top div{font-size:16px;font-weight:500;color:#323233}
	.view-top p{margin:10px 0 25px;font-size:14px;color:#969799;line-height:20px}
	.wechat-icon{color:#4dbe2e}
	.view-button{margin-top:20px}
	.ns-tips {overflow: hidden;}
</style>
{/block}
{block name="main"}
<div class="layui-collapse ns-tips">
	<div class="layui-colla-item">
		<h2 class="layui-colla-title">操作提示</h2>
		<ul class="layui-colla-content layui-show">
			<li>小程序商城需要您在微信公众平台先申请自己的小程序，并且授权给商城使用。</li>
			<li>授权完成即可显示当前小程序商城的信息。有小程序的基础信息，也有小程序的版本信息。</li>
			<li>如果您还没有小程序，需要先去<a href="https://mp.weixin.qq.com/" target="_blank" class="ns-text-color">微信公众平台</a>申请下！申请完公众号后，直接授权给平台，即可拥有自己的小程序商城。
			</li>
		</ul>
	</div>
	<a href="https://kf.qq.com/product/wx_xcx.html#hid=2125" target="_blank" class="view-more">了解更多区别</a>
</div>

<div class="view-content">
	<table class="layui-table" lay-skin="line" lay-size="lg">
		<colgroup>
			<col>
			<col>
			<col>
			<col>
		</colgroup>
		<thead>
			<tr>
				<th>主体类型</th>
				<th>微信支付</th>
				<th>开发者上限</th>
				<th>附近的小程序</th>
				<th>获取用户手机号</th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td>个人</td>
				<td></td>
				<td>10</td>
				<td></td>
				<td></td>
			</tr>
			<tr>
				<td>非个人</td>
				<td><i class="layui-icon layui-icon-ok wechat-icon"></i></td>
				<td>20</td>
				<td><i class="layui-icon layui-icon-ok wechat-icon"></i></td>
				<td><i class="layui-icon layui-icon-ok wechat-icon"></i></td>
			</tr>

		</tbody>
	</table>

</div>
<div class="view-button">
	<a class="view-button-btn view-button-btn-first ns-bg-color" onclick="auth();">我有微信小程序,立即去绑定</a>
	<a class="view-button-btn view-button-btn-last ns-border-color ns-text-color" href="{:addon_url('weapp://shop/weapp/config', [])}">手动添加小程序</a>
</div>
{/block}
{block name="script"}
<script type="text/javascript">
	layui.use(['form'], function () {
		var form = layui.form;
		form.render();
	});

	/**
	 * 去授权
	 */
	function auth(){

		window.open("{:addon_url('wxoplatform://shop/oplatform/auth', ['auth_type' => 'weapp'])}");
		//询问框
		layer.confirm('请在新窗口中继续授权', {
			title:'提示',
			btn: ['重新授权','已完成授权'] //按钮
		}, function(){
			layer.closeAll();
			auth();
		}, function(){
			layer.closeAll();
			//验证是否授权
			$.ajax({
				type: "post",
				url: "{:addon_url('wxoplatform://shop/oplatform/wechatsettled')}",
				dataType: "JSON",
				success: function(data) {
					if(data.code >= 0){
						location.href = "{:addon_url('weapp://shop/weapp/setting')}";
					}

				}
			});
		});
	}
</script>
{/block}